package com.weixing.mall.provider.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.weixing.mall.provider.api.model.vo.KefuVo;
import com.weixing.mall.provider.api.model.vo.RoleVo;
import com.weixing.mall.provider.api.model.vo.SysUserVo;
import com.weixing.mall.provider.model.domain.Role;
import com.weixing.mall.provider.model.domain.User;
import com.weixing.mall.provider.model.query.SysUserQuery;
import com.weixing.mall.provider.api.model.vo.SysUserEditVo;
import com.weixing.mall.provider.model.vo.FrontUserVo;
import com.weixing.mall.provider.model.vo.sys.SysUserRoleVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 系统模块-后台用户表 Mapper 接口
 * </p>
 *
 * @author Small
 * @since 2019-11-18
 */
public interface UserMapper extends BaseMapper<User> {

    IPage<SysUserVo> selectOfPage(@Param("pg") Page page, @Param("qs") SysUserQuery sysUserQuery);

    void resetPwd(Long userId, String password);

    void changeEnable(Long userId, Integer value);

    SysUserEditVo selectSysUserEditVoById(long id);

    List<SysUserRoleVo> selectSysUserByRoleCode(@Param("array") List<String> roleCode,Integer isEnable);

    List<RoleVo> getRoleById(Long id);

    FrontUserVo querySysUser(Long id);

    FrontUserVo queryMemberUser(Long id);

    List<KefuVo> loadKefu();

    KefuVo loadKefuById(Long id);

    IPage<KefuVo> loadKefuOfPage(@Param("pg") Page page);

    KefuVo loadKefuByLoginName(String loginName);
}
